/**
  权限验证
 */

export default function ({ route,store, redirect }) {
  // 不需要验证白名单,则跳到登陆页
  const skipArr = ['login','register','forget_pwd','area_list','agreement','service','download','fingerprint','invite','app_bridge'];
  //skipArr.some((item)=>route.name.startsWith(item)) &&
  // 未登录则跳到登录页面,
  if (!store.getters.isAuthenticated) {
    if(route.matched[0]){
      let path = route.matched[0].path;
      if(!skipArr.some(item=>`/${item}`===path)){
        return redirect('/login')
      }
    }
  }
}
